unit VendaAbertaSearchFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ExtCtrls, Buttons, StdCtrls, DBGrids, MainSearchFr, QueryConditions;

type

  { TVendaAbertaSearchFrame }

  TVendaAbertaSearchFrame = class(TMainSearchFrame)
    valor: TEdit;
    id_venda_aberta: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    procedure BuscarClick(Sender: TObject);
    procedure LocalizarButtonClick(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses
  Initializator, VendaAbertaDM, MainFr;

{ TVendaAbertaSearchFrame }

procedure TVendaAbertaSearchFrame.BuscarClick(Sender: TObject);
begin
  TheControl.ShowForeignFrame(TMainFrame(ProdutoSearchFrame));
end;

procedure TVendaAbertaSearchFrame.LocalizarButtonClick(Sender: TObject);
var
  condicoes: TQueryConditions;
begin
  condicoes := TQueryConditions.Create(CON_AND);
  condicoes.Add('id_venda_aberta', id_venda_aberta.Text);
  condicoes.Add('valor', valor.Text);
  VendaAbertaData.Search(Condicoes, 'venda_aberta');
end;

initialization
  {$I vendaabertasearchfr.lrs}

end.
